package com.qf.controller;

import com.qf.entity.User;
import com.qf.vo.MessageVo;
import com.qf.vo.PageVo;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/rest")
public class RestStyleController {

    @RequestMapping(value = "/test1", method = RequestMethod.GET)
    public MessageVo test1(){
        System.out.println("GET");
        return new MessageVo(true,"GET",null);
    }

    @RequestMapping(value = "/test1", method = RequestMethod.POST)
    public MessageVo test7(@RequestBody User user, PageVo pageVo){
        System.out.println(pageVo);
        System.out.println("POST");
        System.out.println(user);
        return new MessageVo(true,"POST",null);
    }

    @RequestMapping(value = "/test1", method = RequestMethod.DELETE)
    public MessageVo test2(){
        System.out.println("DELETE");
        return new MessageVo(true,"DELETE",null);
    }

    @RequestMapping(value = "/test1", method = RequestMethod.TRACE)
    public MessageVo test3(){
        System.out.println("TRACE");
        return new MessageVo(true,"TRACE",null);
    }

    @RequestMapping(value = "/test1", method = RequestMethod.HEAD)
    public MessageVo test4(){
        System.out.println("HEAD");
        return new MessageVo(true,"HEAD",null);
    }

    @RequestMapping(value = "/test1", method = RequestMethod.OPTIONS)
    public MessageVo test5(){
        System.out.println("OPTIONS");
        return new MessageVo(true,"OPTIONS",null);
    }

    @RequestMapping(value = "/test1", method = RequestMethod.PUT)
    public MessageVo test6(){
        System.out.println("PUT");
        return new MessageVo(true,"PUT",null);
    }

}
